package io.renren.modules.course.service.impl;

import io.renren.modules.oss.entity.MysqlOssEntity;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import io.renren.modules.course.dao.WelfareDao;
import io.renren.modules.course.entity.WelfareEntity;
import io.renren.modules.course.service.WelfareService;


@Service("welfareService")
public class WelfareServiceImpl extends ServiceImpl<WelfareDao, WelfareEntity> implements WelfareService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<WelfareEntity> page = this.selectPage(
                new Query<WelfareEntity>(params).getPage(),
                new EntityWrapper<WelfareEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public void upload(Map<String, Object> param) {
        baseMapper.insertFile(param);
    }

    @Override
    public MysqlOssEntity getImgByName(String name) {
        return baseMapper.getImgByName(name);
    }

}
